package com.zsc.wxm.ysh.anjo.es.feign;

import com.zsc.wxm.ysh.anjo.es.feign.fallback.ResourcesServiceImpl;
import com.zsc.wxm.ysh.anjo.result.Result;
import com.zsc.wxm.ysh.anjo.service.base.model.es.dto.CrawlerDataDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 描述：
 *
 * @author playmaker
 * @since 2021/2/22 22:56
 */
@FeignClient(value = "anjo-house-service", fallback = ResourcesServiceImpl.class)
public interface ResourcesService {

    /**
     * 导入房源数据到es
     *
     * @return
     */
    @PostMapping("/house/resources/batch-upload-es")
    Result batchAddHouseData();

    /**
     * 批量导入楼盘数据
     *
     * @param params
     * @return
     */
    @PostMapping("/house/estate/add-data")
    Result addData(@RequestBody CrawlerDataDTO params);

    /**
     * 获取ES视图对象
     * @param id
     * @return
     */
    @GetMapping("/house/resources/get-es-data-vo-by-id/{id}")
    public Result getEsDataVoById(@PathVariable("id") Long id);
}
